package com.origin.src.lookup;

import com.origin.src.ApplicationTool;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class LookupApplication {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(LookupApplication.class);
        ApplicationTool.printBean(applicationContext);

        XLookup xLookup = applicationContext.getBean(XLookup.class);
        System.out.println(xLookup.lookupBeanMethod() == applicationContext.getBean(LookupBean.class));
        System.out.println(xLookup.lookupBeanMethod1() == applicationContext.getBean(LookupBean1.class));

    }


}
